//
//  HJReportTypeCell.m
//  KaiChat
//
//  Created by lx on 2023/11/28.
//

#import "HJCheckCell.h"

@interface HJCheckCell()

@property (nonatomic, weak) UILabel *titleLabel;
@property (nonatomic, weak) UIImageView *checkImageView;


@end


@implementation HJCheckCell


- (void)settingSubView {
 
    self.backgroundColor = UIColor.whiteColor;
    _titleLabel = [UILabel lableWithSuperView:self.contentView font:UIFontMake(14) color:UIColor.tj_333333Color title:nil textAlignment:NSTextAlignmentLeft];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.offset(0);
    }];
    
    
    UIImageView *checkImageView = [UIImageView addToView:self.contentView];
    checkImageView.image = [UIImage imageNamed:@"check"];
    checkImageView.hidden = YES;
    [checkImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.inset(leftRightMargin);
        make.centerY.offset(0);
    }];
    
    _checkImageView = checkImageView;
}

- (void)setModel:(HJCellModel *)model {
    _model = model;
    
    _titleLabel.text = model.text;
    
    if (model.isSelect) {
        self.backgroundColor = UIColor.tj_F6F6F6Color;
        _titleLabel.font = UIFontMediumMake(14);
        _checkImageView.hidden = NO;
        _titleLabel.textColor = UIColor.tj_333333Color;
    } else {
        self.backgroundColor = UIColor.whiteColor;
        _titleLabel.font = UIFontMake(14);
        _titleLabel.textColor = UIColor.tj_868391Color;
        _checkImageView.hidden = YES;
    }
 
}
 

@end
